package com.trex.lwlsh.model;

import com.trex.lwlsh.util.ReadConfigUtil;

import java.util.HashMap;
import java.util.LinkedHashMap;

/**
 * Create by Trex on 2018/1/13.
 * 配置内容类
 */
public class ConfigModel {



    public String getFilePath() {
        return FilePath;
    }
    private String FilePath; //用例文件路径配置
    private String RunLevel ;//配置需要运行的case等级
    private String tomail;//邮件接收人
    private String Environment;//执行环境
    private String FileList[];//文件数组名：对应template里面如果有多个
    private LinkedHashMap<String, String> map=new LinkedHashMap<String, String>();
    private HashMap<String,  ModuleModel > Table=new  HashMap<String,  ModuleModel>();


    public HashMap<String, ModuleModel> getTable() {
        return Table;
    }

    public void setTable(String key,ModuleModel module) {
        Table.put(key,module);
    }

    public void setFilePath(String filePath) {
        FilePath = filePath;
    }

    public String getRunLevel() {
        setRunLevel();
        return RunLevel;
    }

    public void setRunLevel() {
        RunLevel = ReadConfigUtil.readconfig("Level");
    }

    public String getTomail() {
        setTomail();
        return tomail;
    }

    public void setTomail() {
        //读取邮箱信息
        this.tomail = ReadConfigUtil.readconfig("mail");
    }

    public String getEnvironment() {
        return Environment;
    }

    public void setEnvironment(String environment) {
        Environment = environment;
    }

    public LinkedHashMap<String, String> getMap() {
        return map;
    }

    public void setMap(String key,String value) {
        this.map.put(key,value);
    }


    public String[] getFileList() {
        setFileList();
        return FileList;
    }

    public void setFileList() {
        //获取的value 值后根据,区分
        FileList = ReadConfigUtil.readconfig("Template").split(",");
    }


}
